package cn.com.cifi.mars.constant;

import cn.com.cifi.mars.util.StrUtils;

/**
* @Description:  版本创建方式枚举
* @Author: wy
* @Date:
*/

public enum VersionCreateEnum {

    MONTHCREATE("month_create","月初自动创建"),
    AUTOMATICCREATE("automatic_create","自动创建"),
    MANUALCREATE("manual_create","手动创建"),
    EXCEPTIONCREATE("exception_create","异常创建"),
    AUTOMATICCOPY("automatic_copy","自动复制"),
    MANUALCOPY("manual_copy","手动复制"),
    ;

    private String key;
    private String value;

    VersionCreateEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static String getKeyByValue(String key){
    	if(StrUtils.isNotEmpty(key)) {
    		 for(VersionCreateEnum VersionStatusEnum:VersionCreateEnum.values()){
    	            if(key.equals(VersionStatusEnum.getKey())){
    	                return VersionStatusEnum.getValue();
    	            }
    	        }
    	}
        return  null;
    }

}
